
git config --global user.email "${GIT_NAME}"
git config --global user.name "${GIT_EMAIL}"

# clone the repository to the book-output directory
git clone -b gh-pages \
  https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git \
  book-output

cd book-output
git rm -rf *
cp -r ../cdacode/* ./
git add --all *
git commit -m "Update the book"
git push -q origin gh-pages